import axios from 'axios'

export default {
  async uploadCertification (uploaderId, organization, actName, actTip, attendedStudent) {
    let result = await axios({
      url: '/studentevaluation/api/act/uploadCertification',
      method: 'post',
      data: {
        uploaderId: uploaderId,
        organization: organization,
        actName: actName,
        actTip: actTip,
        attendedStudent: attendedStudent
      }
    })
    return result
  },
  async getCertification (isSubmited, organization) {
    let result = await axios({
      url: '/studentevaluation/api/act/getCertificationByIsSubmitedAndOrganization',
      method: 'get',
      params: {
        isSubmited: isSubmited,
        organization: organization
      }
    })
    return result
  },
  async operateCertificationByActId (operation, actIds) {
    let result = await axios({
      url: '/studentevaluation/api/act/operateCertificationByActId',
      method: 'put',
      contentType: 'application/json;charset=UTF-8',
      data: {
        actIds: JSON.stringify(actIds),
        operation: operation
      }
    })
    return result
  },
  async getActStudentsByActId (actId) {
    let result = await axios({
      url: '/studentevaluation/api/attendedstudentlist/getActStudents/{actId}',
      method: 'get',
      params: {
        actId: actId
      }
    })
    return result
  }

}
